package com.msg.producer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.msg.jms.QueueSenderObject;

import basic.base.web.BaseController;


@Controller
@RequestMapping(value = "/producer")
public class ProducerController extends BaseController {

	@Autowired
	QueueSenderObject queueSenderObject;

	/**
	 * 发送消息到队列
	 * 
	 * @param message
	 * @return String
	 */
	@ResponseBody
	@RequestMapping("logQueueSendernew")
	public String logQueueSendernew() {
		String opt = "";
		try {
			queueSenderObject.sendMessage("test.topic", null);
			opt="success";
		} catch (Exception e) {
			e.printStackTrace();
			opt = e.getCause().toString();
		}
		return opt;
	}
}
